A Meticulous Analysis of Mergesort Programs

نویسندگان

  • Jyrki Katajainen
  • Jesper Larsson Träff
چکیده

Abst rac t . The efficiency of mergesort programs is analysed under a simple unit-cost model. In our analysis the time performance of the sorting programs includes the costs of key comparisons, element moves and address calculations. The goal is to establish the best possible time-bound relative to the model when sorting n integers. By the well-known information-theoretic argument n log 2 n O(n) is a lower bound for the integer-sorting problem in our framework. New implementations for two-way and four-way bottom-up mergesort are given, the worst-case complexities of which are shown to be bounded by 5.5nlog 2 n + O(n) and 3.25nlog 2 n + O(n), respectively. The theoretical findings are backed up with a series of experiments which show the practical relevance of our analysis when implementing library routines for internal-memory computations.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Efficient On-Chip Pipelined Streaming Computations on Scalable Manycore Architectures

Performance of manycore processors is limited by programs’ use of off-chip main memory. Streaming computation organized in a pipeline limits accesses to main memory to tasks at boundaries of the pipeline to read or write to main memory. The Single Chip Cloud computer (SCC) offers 48 cores linked by a highspeed on-chip network, and allows the implementation of such on-chip pipelined technique. W...

متن کامل

Design and Analysis of Cache-Conscious Programs

This thesis is presented in partial fulfillment of the Danish Kandidatgrad i Datalogi (candidatus scientiarium in Computer Science) at the University of Copenhagen, and was written during the autumn and winter of 1998 under the supervision of Jyrki Katajainen. The cache behaviour of programs is studied. It is common knowledge that the cache memory subsystem induces an overhead on the execution ...

متن کامل

Improving Mergesort for Linked Lists

We present a highly tuned mergesort algorithm that improves the cost bounds when used to sort linked lists of elements. We provide empirical comparisons of our algorithm with other mergesort algorithms. The paper also illustrates the sort of techniques that allow to speed a divide-and-conquer algorithm.

متن کامل

Branch Mispredictions Don't Affect Mergesort

In quicksort, due to branch mispredictions, a skewed pivotselection strategy can lead to a better performance than the exactmedian pivot-selection strategy, even if the exact median is given for free. In this paper we investigate the effect of branch mispredictions on the behaviour of mergesort. By decoupling element comparisons from branches, we can avoid most negative effects caused by branch...

متن کامل

Mellin Transforms and Asymptotics The Mergesort Recurrence

Mellin transforms and Dirichlet series are useful in quantifying periodicity phe nomena present in recursive divide and conquer algorithms This note illustrates the tech niques by providing a precise analysis of the standard top down recursive mergesort algo rithm in the average case as well as in the worst and best cases It also derives the variance and shows that the cost of mergesort has a G...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1997